unit CardType;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Controls, Forms,
  Dialogs, StdCtrls, Buttons, CommonTypes;

type
  TfrmCardType = class(TForm)
    Label1: TLabel;
    cbbCardType: TComboBox;
    btnOK: TButton;
    btncancel: TButton;
    procedure FormCreate(Sender: TObject);
    procedure btnOKClick(Sender: TObject);
  private
    FCardType: TCardType;
    procedure SetCardType(const Value: TCardType);
    function GetCardType: TCardType;
    { Private declarations }
  public
    { Public declarations }
    property CardType: TCardType read GetCardType write SetCardType;
  end;



var
  frmCardType: TfrmCardType;

implementation


{$R *.dfm}

procedure TfrmCardType.btnOKClick(Sender: TObject);
begin
  modalResult := mrOk;
end;

procedure TfrmCardType.FormCreate(Sender: TObject);
var
  cardType: TCardType;
begin
  cbbCardType.Clear;
  for CardType in [Card_ID, Card_MF] do
    cbbCardType.Items.Add(gstrCardtype[CardType]);
end;

function TfrmCardType.GetCardType: TCardType;
begin
  FCardType := TCardType(cbbCardType.ItemIndex);
  Result := FCardType;
end;

procedure TfrmCardType.SetCardType(const Value: TCardType);
begin
  FCardType := Value;
  cbbCardType.ItemIndex := Integer(Value);
end;

end.
